{% extends "layout.html" %}
{% block content %}
<div class="container">
    <br />
    <div class="card">
        <div class="card-body">
            <div class="row">
                <div class="col">
                    <h2>{{ _('Your subscriptions') }}</h2>
                    <p>{{ _('You are subscribed to') }} {{ nb_feeds }} <a href="{{ prefix() }}/feeds">{{ _('feeds') }}</a>. <a href="{{ url_for('feed.form') }}">{{ _('Add') }}</a> {{ _('a feed') }}.</p>
                    <p>{{ nb_articles | numberformat }} {{ _('articles are stored in the database with') }} {{ nb_unread_articles | numberformat }} {{ _('unread articles') }}.</p>
                    <p>{{ _('You have') }} {{ nb_categories }} <a href="{{ url_for('categories.list_')}}">{{ _('categories') }}</a>.</p>
                    <a href="{{ url_for('articles.expire', weeks=10) }}" class="btn btn-primary" onclick="return confirm('{{ _('You are going to delete old articles.') }}');">{{ _('Delete articles older than 10 weeks') }}</a>
                </div>
            </div>
        </div>
    </div>
    <br />
    <div class="card">
        <div class="card-body">
            <div class="row">
                <div class="col">
                    <h2>{{ _('Your data') }}</h2>
                    <br />
                </div>
            </div>
            <div class="row">
                <div class="col">
                    <h3>{{ _('Articles') }}</h3>
                </div>
            </div>
            <div class="row">
                <div class="col">
                    <h5>{{ _('Import') }}</h5>
                    <p>{{ _('Import a Newspipe account (*.json).') }}</p>
                    <form action="" method="post" id="formImportJSON" enctype="multipart/form-data">
                        <input type="file" name="jsonfile" />
                        <button class="btn btn-primary" type="submit">OK</button>
                    </form>
                </div>
                <div class="col">
                    <h5>{{ _('Export') }}</h5>
                    <p>{{ _('Export your newspipe account to JSON.') }}</p>
                    <a href="{{ url_for('articles.export') }}" class="btn btn-primary">{{ _('Export') }}</a>
                </div>
            </div>
            <hr />
            <div class="row">
                <div class="col">
                    <h3 id="import">{{ _('Feeds') }}</h3>
                </div>
            </div>
            <div class="row">
                <div class="col">
                    <h5>{{ _('Import') }}</h5>
                    <p>{{ _('Import feeds from OPML (*.xml or *.opml).') }}</p>
                    <form action="" method="post" id="formImportOPML" enctype="multipart/form-data">
                        <input type="file" name="opmlfile" />
                        <button class="btn btn-primary" type="submit">OK</button>
                    </form>
                </div>
                <div class="col">
                    <h5>{{ _('Export') }}</h5>
                    <p>{{ _('Export feeds to OPML.') }}</p>
                    <form class="form" action="{{ url_for('feeds.export') }}" method="GET" id="formExportOPML">
                        <div class="form-group">
                            <div class="form-check">
                              <input type="checkbox" class="form-check-input" name="includedisabled" checked />
                              <label class="form-check-label">Include disabled feeds</label>
                            </div>
                            <div class="form-check">
                              <input type="checkbox" class="form-check-input" name="includeexceedederrorcount" checked />
                              <label class="form-check-label" title="Newspipe encountered too much problems when retrieving these feeds.">Include dead feeds</label>
                            </div>
                            <div class="form-check">
                              <input type="checkbox" class="form-check-input" name="includeprivate" checked />
                              <label class="form-check-label">Include private feeds</label>
                            </div>
                        </div>
                        <button class="btn btn-primary" type="submit">{{ _('Export') }}</button>
                    </form>
                </div>
            </div>
            <hr />
            <div class="row">
                <div class="col-md-12">
                    <br />
                    <h2>{{ _('Your bookmarks') }}</h2>
                    <div class="col">
                      <p>{{ _('You have') }} {{ nb_bookmarks | numberformat }} <a href="{{ url_for('bookmarks.list_')}}">{{ _('bookmarks') }}</a>.</p>
                      <a href="{{ url_for('bookmarks.export') }}" class="btn btn-primary">{{ _('Export your bookmarks to JSON') }}</a>
                      <a href="{{ url_for('bookmarks.delete_all') }}" class="btn btn-primary" onclick="return confirm('{{ _('You are going to delete all bookmarks.') }}');">{{ _('Delete all bookmarks') }}</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div><!-- /.container -->
{% endblock %}
